package com.bootx;

import dev.langchain4j.model.openai.OpenAiChatModel;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/openAi")
public class OpenAiController {

    @GetMapping("/chat1")
    public String chat1(String content){
        OpenAiChatModel model = OpenAiChatModel.builder()
                .baseUrl("https://chatapi.littlewheat.com/v1")
                .apiKey("sk-3EhLauTvF1FVvw4CnhefIYH8jcVDuSWary7K3IEHJC0L09Hm")
                .modelName("gpt-4o")
                .build();
        return model.chat(content);
    }

}
